import os
# def showfile(path):
#     print(f'path={path}')
#     list1=os.listdir(path)
#
#     for file in list1:
#         filepath= path + '\\'+ file
#         if os.path.isfile(filepath):
#             print(f'文件:{filepath}')
#         else:
#             showfile(filepath)
# showfile(r'D:\APPS\PyCharm\PythonProject\Task')


def showpyfile(path):
    print(f'path={path}')
    list1 = os.listdir(path)

    for file in list1:
        filepath = path + '\\' + file
        if os.path.isfile(filepath):
            if filepath.endswith('.py'):
                print(f'文件:{filepath}')
        else:
            showpyfile(filepath)

showpyfile(r'/基础/Task')
